package com.git.service.impl;

import com.git.bean.Users;
import com.git.mapper.UsersMapper;
import com.git.service.UserService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 高源蔚
 * @date 2021/12/23-10:30
 * @describe
 */
@Service
@Component
public class UserServiceImpl implements UserService {

    @Autowired
    private UsersMapper usersMapper;

    @Override
    public void addUser(Users users) throws Exception{
        usersMapper.insertSelective(users);
    }

    @Override
    public Users findUserById(Integer id) throws Exception{
        Users users = usersMapper.selectByPrimaryKey(id);
        return users;
    }
}
